<!DOCTYPE html>
<html>
<head>
    <title>登入</title>
    <#include "/common/include_header.ftl">
</head>
<body>

    <#include "/common/include_top.ftl">

<div class="layui-container fly-marginTop">
    <div class="fly-panel fly-panel-user" pad20>
        <div class="layui-tab layui-tab-brief" lay-filter="user">
            <ul class="layui-tab-title">
                <li class="layui-this">登入</li>
                <li><a href="reg">注册</a></li>
            </ul>
            <div class="layui-form layui-tab-content" id="LAY_ucm" style="padding: 20px 0;">
                <div class="layui-tab-item layui-show">
                    <div class="layui-form layui-form-pane">
                        <#--<form method="post">-->
                            <div class="layui-form-item">
                                <label for="L_email" class="layui-form-label">邮箱</label>
                                <div class="layui-input-inline">
                                    <input type="text" id="email" name="email" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label for="L_pass" class="layui-form-label">密码</label>
                                <div class="layui-input-inline">
                                    <input type="password" id="pwd" name="pass" autocomplete="off" class="layui-input">
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <button onclick="doLogin()" class="layui-btn" lay-filter="*">立即登录</button>
                                <span style="padding-left:20px;">
                                  <#--<a href="forget">忘记密码？</a>-->
                                </span>
                            </div>




                        <#--</form>-->
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<#include "/common/include_footer.ftl">
<#include "/common/include_js.ftl">

<script>
    function doLogin() {
        var email = $("#email").val();
        var pwd = $("#pwd").val();
        var path = $("#path").val();

        if (hasNull(email, pwd)) {
            layer.msg('数据不能为空' , {icon: 2});
        } else {
            $.ajax({
                url: '${basePath}/user/doLogin',
                type: 'post',
                dataType: 'json',
                data: {
                    email: email,
                    pwd: pwd
                },
                success: function (rd) {
                    if (rd.suc) {
                        window.location.href = "${basePath}/user/index";
                    } else {
                        layer.msg(rd.msg, {icon: 2});
                    }
                }
            })
        }





    }
</script>
</body>
</html>